<template>
    <!-- #ifdef APP-NVUE -->
    <cell @appear="getPage" @click="click" :recycle="recycle" v-if="!tag">
        <slot />
    </cell>
		<header v-else-if="tag == 'header'">
			<slot />
		</header>
		<view v-else-if="tag == 'view'">
			<slot />
		</view>
    <!-- #endif -->
    <!-- #ifndef APP-NVUE -->
    <view @click="click">
        <slot />
    </view>
    <!-- #endif -->
</template>

<script>
    export default {
        name: 'UniCell',
        props: {
					index: {
						type: Number,
						default: 0
					},
					recycle: {
						type: Boolean,
						default: true
					},
					tag: {
						type: [Boolean, String],
						default: false
					},
				},
				methods:{
					getPage() {
						this.$emit('getPage', this.index);
					},
					click() {
						this.$emit('click');
					}
				}
    }
</script>
